package com.car.dal.dao.leave;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.Leave;
import com.car.dal.object.TgDemand;
import com.car.dal.object.TgTravel;
import com.car.util.Page;

public class LeaveDaoImpl extends IbatisCommonDao<Leave, Long> implements LeaveDao {

	@Override
	public GridObj GetList(Leave leave, PageObj pageObj) {
		// TODO Auto-generated method stub
		OrderObj order = new OrderObj();
		order.setDir("asc");
		order.setSort("id");
		// TODO Auto-generated method stub
		return super.findByPage(leave, pageObj, order);
	
	}

	@Override
	public Integer getLeaveCountByType(Leave leave) {
		// TODO Auto-generated method stub
		return this.queryForInteger("getLeaveCountByType", leave);
	}

	@Override
	public List<Leave> getLeaveByType(Leave leave, Page page) {
		// TODO Auto-generated method stub
		leave.setFirstrownum(page.getFirstrownum());
		leave.setPagesize(page.getPagesize());
		return this.queryForEntityList(Leave.class,"getLeaveByType", leave);
	}

}
